#include <iostream>

using namespace std;

void t(int* p) {}

void u(const int* cip) 
{ 
	// *cip = 2; // Illegal 
	int i = *cip; // OK 
	// int* ip2 = cip; // Illegal
}

const char* v( ) {
	char* c;
	return c;
}

const int* const w( ) {
	int* i;
	return i;
}

int main(int argc, char *argv[]) {
	int x = 0;
	
	int* ip = &x;
	const int* cip = &x;

	t(ip); // OK
	//t(cip);  error	 -- const* 不可赋值给 普通*
	
	u(ip); // OK
	u(cip); // Also OK
	
	//char* cp = v(); 	error	const char* 不可赋值给 char*
	const char* ccp = v(); 
	
	//int* ip2 = w(); 	error	const int* 不可赋值给 int*
	const int* const ccip = w(); 
	const int* cip2 = w(); // OK
	
	//*w() = 1;  error	const不可改变
}